//
//  MovieRoleOfOne.m
//  MINFOBBS
//
//  Created by juvid on 13-12-3.
//  Copyright (c) 2013年 minfo. All rights reserved.
//

#import "MovieRoleOfOne.h"
#import "MovieRole.h"
#import "MovieLyrics.h"
#import "MainSearchViewController.h"
@interface MovieRoleOfOne ()

@end

@implementation MovieRoleOfOne

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.labRole.text=[[[[self.arrReturn objectForKey:@"Items"] objectForKey:@"Item"] objectAtIndex:0] objectForKey:@"Title"];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (MainSearchViewController *)menuContainerViewController {
    return (MainSearchViewController *)self.parentViewController;
}
- (IBAction)PressRole:(id)sender {
    MovieLyrics *detailViewController = [[MovieLyrics alloc] init];
    detailViewController.strContent=[self GetQuery:0];
    detailViewController.isSelf=YES;
    [ [self menuContainerViewController].navigationController  pushViewController:detailViewController animated:YES];
}

- (IBAction)PressOther:(id)sender {
    MovieRole *jokecon = [[MovieRole alloc] init];
    jokecon.strKey= [self  GetQuery:1];
    [ [self menuContainerViewController].navigationController  pushViewController:jokecon animated:YES];
    
}
-(NSString *)GetQuery:(int)count{
    NSString *str=[[[[self.arrReturn objectForKey:@"Links" ] objectForKey:@"Link"]objectAtIndex:count] objectForKey:@"href"];
    NSRange range = [str rangeOfString:@"query="];
    str=[str substringFromIndex:range.location +range.length];
    return str;
}
@end
